package io.renren.controller;

import com.alibaba.fastjson.support.config.FastJsonConfig;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.imps.CuratorFrameworkState;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: xlr
 * @Date: Created in 下午1:10 2018/9/1
 */
@RequestMapping("/curator")
@RestController
public class CuratorController {

    @Autowired
    CuratorFramework client;


    @RequestMapping("/startus")
    @ResponseBody
    public String startus(){
        CuratorFrameworkState state = client.getState();
        System.out.println( state.name());
        return state.toString();
    }
}
